/*
 * @Author: sky 1575951471@qq.com
 * @Date: 2024-05-07 23:57:06
 * @LastEditors: sky 1575951471@qq.com
 * @LastEditTime: 2024-12-04 00:04:47
 * @FilePath: \sky-esp32-Base\main\main.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "nvs_flash.h"
#include "esp_system.h"
#include "esp_chip_info.h"
#include "esp_psram.h"
#include "esp_flash.h"
#include "led.h"
#include "i2c.h"
#include "xl9555.h"
#include "spi.h"
#include "lcd.h"
#include "esp_log.h"
#include "lvgl_config.h"

const char *TAG = "main";

void app_main(void)
{
    esp_err_t ret;

    ret = nvs_flash_init();                         //初始化NVS
    if(ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
    {
        ESP_ERROR_CHECK(nvs_flash_erase());
        ret = nvs_flash_init();
    }
    led_init();
    i2c_init_num0();
    spi2_init();
    xl9555_init();           /* 初始化XL9555 */
    // lcd_init();
    lvgl_demo();
    ESP_LOGI(TAG, "LCD Init succeed");
    // while(1)
    // {
    //     vTaskDelay(1000);
    // }

}
